<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

class SignUserRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'identity' => ['required', 'max:19', 'unique:sign_users,identity'],
        ];
    }

    public function messages()
    {
        return [

            'identity.unique' => '用户已经存在',
            'identity.required' => '用户身份证信息不能为空',
            'identity.max' => '身份证最大长度为19个字符',

        ];
    }
}
